package com.foxire.demo;

public class SilverCard extends Card{
    public SilverCard(String cardId, String name, String phone, double money) {
        super(cardId, name, phone, money);
    }

    public void consume(double money) {
        System.out.println("您当前消费金额："+money);
        System.out.println("尊敬的银卡用户，优惠后金额："+(money*0.9));
        if(getMoney() < money * 0.9){
            System.out.println("您的余额为"+getMoney()+"当前余额不足，消费失败");
            return;
        }
        // 更新银卡账户余额
        setMoney(getMoney()-money*0.9);
        System.out.println("消费成功，当前余额为："+getMoney());
    }
}
